import { createApp, h } from "vue";

import App from "./App.vue";

import { createWebHashHistory, createRouter } from "vue-router";

import User from "./views/User.vue";
import Home from "./views/Home.vue";
import Login from "./views/Login.vue";
import Shop from "./views/Shop.vue";
import Body from "./views/Body.vue";
import Header from "./views/Header.vue";

localStorage.token = "";
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/home",
      component: Home,
    },
    {
      path: "/shop/:id/row/:rid",
      component: Shop,
      props(route) {
        return {
          name: "jack",
          age: 20,
          ...route.params,
          ...route.query,
        };
      },
    },
    {
      path: "/user",
      component: User,
      props: {
        name: "jack",
        age: 20,
      },
    },
  ],
});

const app = createApp({ render: () => h(App) });

app.use(router);

app.mount("#app");
